import React from 'react';
// import ButtonView from '../view-button';
// import { ListItemProps } from '../../stores/mode-app/BaseStore';
import classNames from 'classnames';
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

// export interface ListItemCompProps {
//     data: ListItemProps;
//     onClick?: (key: string,special:any) => void;
//     showIcon?: boolean;
//     currentKey?:string
// }
export default class ListItem extends React.Component {
    onClick = () => {
        const { data, onClick } = this.props;
        onClick && onClick(data.key, data.special);
    }

    render() {
        const { data, currentKey } = this.props;
        const className = classNames('prj-list-item-content');
        let isCurrent = currentKey && currentKey == data.key;
        return (
            <div
                component="span"
                className="prj-list-item"
                onClick={this.onClick}
            >
                <div style={isCurrent ? { 'background-color': '#def0ff' } : {}}>
                    <div className={className}>
                         <div className="name-state" style={{backgroundColor:data.color}}>{data.state}</div>
                        <div className="prj-list-item-content-top">
                            <div className="name-wrapper" title={data.name}>{data.name}</div>
                            <div className="subname-wrapper">
                                <span>{`${getLabel('16573',"项目经理") + " : "+ data.person }`}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}

